import React from 'react';
import { Breadcrumb, Button, Tabs } from 'antd';
import ChangePwd from './changePwd';
import BindPhone from './bindPhone';
const TabPane = Tabs.TabPane;

const List = React.createClass({

  getInitialState() {
    return {
      active: '1'
    }
  },

  componentDidMount() {
    let obj = this.props.location.state;
    this.setState({active: obj ? obj.key : '1'})
  },

  handleChange(e) {
    this.setState({
      active: e
    })
  },

  render() {
    return (
      <div className="inner-content">
        <Tabs type="card" activeKey={this.state.active} onChange={this.handleChange}>
          <TabPane tab="修改密码" key="1">
            <ChangePwd />
          </TabPane>
          <TabPane tab="绑定手机" key="2">
            <BindPhone />
          </TabPane>
        </Tabs>
      </div>
    );
  }
});

export default List